/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nominalitzacions.stubs;
import java.util.*;

/**
 *
 * @author sonia.sandalinas
 */
public class Dictionary<T extends String> extends TreeSet {

    public Dictionary(){
        super();
    }

    public void insertString(String verb){
         this.add(verb);
    }

    public boolean deleteString(String verb) {
        return this.remove(verb);
    }
    public boolean searchString(String verb){
        return this.contains(verb);
    }
    public void putAllDictionary(String[] totDiccionari)
    {
        for (int i = 0; i < totDiccionari.length; ++i) {
            String verb = totDiccionari[i];
            add(verb);
        }
    }
     public String[] acquireAllDictionary()
    {
        String[] totDiccionari = new String[this.size()];
        int index = 0;
        Iterator itDiccionari = this.iterator();
        while (itDiccionari.hasNext()){
            String verb = (String) itDiccionari.next();
            totDiccionari[index] = verb;
            ++index;

        }
        return totDiccionari;
    }
}